#include<iostream>
#include<cmath>
using namespace std;

class Point {
    private:
        float X,Y;
    public:
        Point(float xi,float yi) {
            X = xi;
            Y = yi;
        }

        double getX() {
            return X;
        }

        double getY() {
            return Y;
        }
        // don't declare friend function,don't access
        // private var.
        friend float distance(Point&,Point&);
};

float distance(Point& a,Point& b) {
    float dx = a.X - b.X;
    float dy = a.Y - b.Y;
    return (dx * dx,dy * dy);
}

int main() {
    Point p1(3.5,3.5),p2(4.5,6.5);
    cout << "The distance is " << distance(p1,p2) << endl;
    return 0;
}
